package com.graduate.daydayup.activity

import android.os.Bundle
import com.blankj.utilcode.util.LogUtils
import com.blankj.utilcode.util.ToastUtils
import com.graduate.daydayup.R
import com.graduate.daydayup.base.BaseActivity
import com.graduate.daydayup.room.NoteType
import com.graduate.daydayup.room.noteTypeDao
import kotlinx.android.synthetic.main.activity_addnotetype.*

class NoteTypeAddActivity:BaseActivity() {
    override fun setTitle()="添加便签分类"

    override fun getLayout()= R.layout.activity_addnotetype

    override fun setTextRight()=""

    override fun setImgRightListener() {

    }

    override fun isAddToolbar()=true

    override fun initViewIds() {

    }

    override fun initView() {
        btn_save.setOnClickListener {
            if (et_notetype.text.toString().isEmpty()){
                ToastUtils.showShort("便签分类为空")
            }else{
                noteTypeDao?.addNotes(NoteType(0,et_notetype.text.toString()))
                ToastUtils.showShort("添加成功")
                finish()
            }
        }
    }

    override fun initData(savedInstanceState: Bundle?) {

    }
}